﻿#region using statements

using System;

using AeonOfStrife.Misc;

using Microsoft.Xna.Framework.Graphics;

using NGen;
using NGen.Managers.GameObject;

#endregion

namespace AeonOfStrife.Objects
{
	public class PlayBackground : GameObject2D
	{
		protected override void _Initialize() {
			m_texture = GameEngine.GameContent.Load<Texture2D>("Content\\Textures\\Backgrounds\\background");
			GameEngine.GameWindow.ClientSizeChanged += GameWindow_ClientSizeChanged;
			m_scale.X = (1f / (m_texture.Width)) * GameEngine.GameWindow.ClientBounds.Width * 3;
			m_scale.Y = ((GameEngine.GameWindow.ClientBounds.Height) / (float) m_texture.Height);
			m_zDepth = 0.01f;
		}

		protected override void _Draw(Microsoft.Xna.Framework.GameTime p_gameTime) {
			base._Draw(p_gameTime);
			//GameEngine.GetService<PathfindingData>().DrawDebug();
		}
		private void GameWindow_ClientSizeChanged(object p_sender, EventArgs p_e) {
			m_scale.X = (1f / (m_texture.Width)) * GameEngine.GameWindow.ClientBounds.Width * 2;
			m_scale.Y = (m_texture.Height) / ((float) GameEngine.GameWindow.ClientBounds.Height);
		}
	}
}